﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEditor.Sprites;
using UnityEngine;
using Random = UnityEngine.Random;

namespace StarForce {
    public class UiTexturePicker : MonoBehaviour {
        [SerializeField] private Sprite[] myTextureList;
        private SpriteRenderer spriteRenderer;

        private void Awake() {
            spriteRenderer = this.GetComponent<SpriteRenderer>();
            if (myTextureList.Length > 0) {
                var randomIndex = Random.Range(0, myTextureList.ToList().Count);
                spriteRenderer.sprite = myTextureList[randomIndex];
            }
        }
    }

}
